package com.tubi.zifuliu;

import java.io.UnsupportedEncodingException;
import java.util.Arrays;

public class 字符流 {
    public static void main(String[] args) throws UnsupportedEncodingException {
//        编码
        String s = "荣磊";
        byte[] bytes1 = s.getBytes();
        System.out.println(Arrays.toString(bytes1));

        byte[] bytes2 = s.getBytes("UTF-8");
        System.out.println(Arrays.toString(bytes2));

//        解码
        byte[] ss = {-24, -115, -93, -25, -93, -118};
        String a = new String(ss);
        System.out.println(a);
    }

}
